get all indices of a value in list python

27

indices = [i for i, x in enumerate(my_list) if x == "whatever"]

Comments

Submit
0 Comments